package param_type

import "permission/databases"

type ApiFunctionsInfoResponse struct {
	Data []databases.Tpo_Sys_Functions
}

type ApiUserInfoResponse struct {
	databases.Tpo_Sys_Users
	HomePage string
}

type ApiUserListResponse struct {
	TpoSysUsers []databases.Tpo_Sys_Users `json:"Tpo_Sys_Users"`
}

// 会话信息
type ApiSessionInfoResponse struct {
	TpoSysUsers              ApiUserInfoResponse                     `json:"Tpo_Sys_Users"`
	TpoSysFunctions          []databases.Tpo_Sys_Functions           `json:"Tpo_sys_Functions"`
	TpoSysNavigations        []ApiTpoSysNavigation                   `json:"Tpo_Sys_Navigations"`
	TpoSysNavigationFunction []databases.Tpo_Sys_Navigation_Function `json:"Tpo_Sys_Navigation_Function"`
	TpoSysRoles              []databases.Tpo_Sys_Roles               `json:"Tpo_Sys_Roles"`
	TpoAliyunMQ              interface{}                             `json:"Tpo_Aliyun_MQ"`
}

// 权限
type ApiRoleInfoResponse struct {
	Data []databases.Tpo_Sys_Roles `json:"Tpo_Sys_Roles"`
}

// app 菜单
type ApiAppNavigationRes struct {
	TpoSysNavigations []ApiTpoSysNavigation `json:"Tpo_Sys_Navigations"`
}

// 菜单
type ApiTpoSysNavigation struct {
	databases.Tpo_Sys_Navigations
	ChildNavigations []ApiTpoSysNavigation
}

// 部门
type ApiTpoSysDepart struct {
	databases.Tpo_Sys_Departments
	UserList         []databases.Tpo_Sys_Users
	ChildDepartments []ApiTpoSysDepart
}

// 根据角色返回部门和用户 tree
type ApiDepartmentRoleResponse struct {
	RoleDepartUser ApiTpoSysDepart
	TpoSysUsers    []databases.Tpo_Sys_Users `json:"Tpo_Sys_Users"`
}

// 所有用户
type ApiUserAllResponse struct {
	TpoSysUsers map[int64]databases.Tpo_Sys_Users `json:"Tpo_Sys_Users"`
}

// 部门返回
type ApiDepartmentResponse struct {
	Tpo_Sys_Departments []ApiTpoSysDepart
}

// 用户部门返回 + 虚拟部门
type ApiDepartmentVirtualResult struct {
	ApiDepartmentResponse
	Tpo_Sys_Departments_Virtual []ApiTpoSysDepart
}

type ApiLeaderResponse struct {
	Leader []LeaderData
}

type LeaderData struct {
	DepartId   int64
	DepartName string
	LeaderName []struct {
		UserId   int64
		UserName string
	}
	ParentLeader *LeaderData `json:"ParentLeader,omitempty"`
}
